<script type="application/javascript">
	$(document).ready(function(){
	//	
	})
	$('#save_pdf').click(function(){
		$.ajax({
			type: "POST",
			url: '/pmp/report/',
			data: {'report_content': $('#report_content').html()},
			success: function(data){
				window.location.href=data
			}
		});
	})
	$('#print_page').click(function(){
		$('#report_content').printElement();
	})
    $('#deviceSummary').click(function (){
		projectId = sessvars.sessionObj.projectId
		var win = window.open('/pmp/utils?projectId=' + projectId + '&utilType=deviceInstanceSummary', 'device', 'height=650,width=700,resizable=yes,scrollbars=yes');
		win.focus();
		return false;       
	})
	
</script>
<div align="right">
<!--<a href="#" id="save_pdf" title="Save as PDF"><i class="icon-download"></i></a>&nbsp;-->
<a href="#" id="print_page" title="Send to printer"><i class="icon-print"></i></a>
</div>
<div id="report_content">
<h2>CBE Building Performance Evaluation Toolkit Report</h2>
<p>
	This report summarizes the IEQ performance of the {{ bi_name }} building. The results are a product of the devices used in this study 
	and should be interpreted with corresponding limitations in mind. Where relevant, helpful advice on interpretation of results is
	provided in each section of this report 
</p>
<h3>Scorecard</h3>
<h3>Building information</h3>
<div class="row" style="margin-bottom: 15px; margin-top: 10px">
	<div class="span3">
		<img src="{{bi_image}}" width="250px" height="280px">
	</div>
	<div class="span4" style="margin-left: 0px">
		<table class="table table-condensed">
			<tr>
				<td>Building name:</td>
				<td>{{bi_name}}</td>
			</tr>
			<tr>
				<td>City:</td>
				<td>{{bi_city}}</td>
			</tr>
			<tr>
				<td>Area:</td>
				<td>{{bi_area}} ft<sup>2</sup></td>
			</tr>
			<tr>
				<td>Building type:</td>
				<td>{{bi_building_type}}</td>
			</tr>
		</table>
	</div>
</div>
<h4>Summary of zones and devices</h4>
{% if bi_maps %}
{% for map in bi_maps %}
	<p>
	<img src="{{map.url}}">&nbsp;&nbsp;<img src="/static/pmp/img/deviceSummaryLegend.PNG"><br>
	Figure: {{ map.caption }}.
	</p>
{% endfor %}
{% endif %}
{% if not bi_maps %}
	<p><small><b>Note: </b>You have not saved any maps showing a summary of zones and device instances. 
		Visit the <a href="#" id="deviceSummary">device instances summary page </a> and upload screenshots to enable this part of the report.</small></p>
{% endif %}
<h3>Thermal comfort</h3>
<h4>Objective measurement notes</h4>
<p>Thermal comfort is characterized by two personal variables (clothing insulation and metabolic activity) and four physical variables: 
	air temperature, relative humidity, air speed, and mean radiant temperature. From these parameters, operative temperature can also be 
	computed, which represents the combination of the convective and radiant components of heat transfer resulting in a close approximation of 
	the temperature humans feel in an environment. Operative temperature is used in ASHRAE Standard 55 for determining comfort.
	In the toolkit, thermal comfort is primarily assessed using ICMs, though stratified systems may also use the UFAD commissioning cart. The ICM measures dry-bulb temperature using a radiation-shielded thermistor. Both the globe temperature sensor and the dry-bulb temperature sensor 
	use thermistors that are accurate to 0.1°C with 1% interchangeability. Globe temperature, air speed, and dry-bulb temperature are used to 
	compute mean-radiant temperature corrected for sphere diameter according to an equation available in ISO 7726. Operative temperature is determined from 
	mean-radiant temperature and dry-bulb temperature. Currently, air-velocity is not included in the computation of comfort in the Toolkit, though
	is available if the user wants to use an elevated air speed model or the adaptive comfort model.
	</p>
<h4>Survey vs. objective measurements notes</h4>
	<p>The thermal comfort measurements give the user a very detailed picture of the thermal conditions of the spaces measured. Thermal comfort
		includes a subjective component, which can be seen in the survey results. The CBE survey thermal comfort questions cover temperature, productivity, control, and relation to local weather conditions. The survey results 
		provide a clear indication of user impressions of the thermal environment and how it may be improved. Thermal comfort represents the best IEQ category for comparing
		the survey results and objective measurement results though there are still many reasons for possible disagreement between objective and subjective
		results. The PPD/PMV comfort model is not perfect and very sensitive to clothing level and metabolic rate which can vary widely across an office population.</p>
{% if user_chart_categories.tc > 0 %}
<h4>User charts</h4>
{% for chart in user_charts %}
	{% if chart.category == 'Thermal Comfort' %}
		<img src="{{chart.url}}">{{ chart.legend|safe }}<br>
		Figure: {{chart.caption}}<br>
	{% endif %}
{% endfor %}
{% endif %}

<h3>Lighting</h3>
<h4>Objective measurement notes</h4>
<p>
	Illuminance is the only variable currently measured by the Toolkit ICMs. In addition to evaluating light levels continuously, this measurement can provide clues to proper operation of 
	electric lighting schedules, automated blind operation, and task light operation. Used with pyranometer data or lighting controller data, daylight harvesting strategies can also be evaluated. 
	The best way to evaluate proper	electric lighting levels is to take measurements at night with the lights on and the sensors on the work plane. 
</p>
<h4>Survey vs. objective measurement notes</h4>
	<p>The CBE survey lighting questions cover amount of light, productivity, controls, daylight, and visual comfort (glare, reflections, contrast). Because the objective measurement (illuminance)
	is primarily a measure of amount of light, the survey results and objective measurement results will not necessarily be correlated. Often times, occupants are disatisfied with the lighting
	control system, which can be evaluated using illuminance measurements and a test procedure designed to capture the control element in question. If glare and reflections are a problem 
	for occupants, spot luminance measurements can be taken to help resolve the problems.</p>
{% if user_chart_categories.lighting > 0 %}
<h4>User charts</h4>
{% for chart in user_charts %}
	{% if chart.category == 'Lighting' %}
		<img src="{{chart.url}}"><br>
		Figure: {{chart.caption}}<br>
	{% endif %}
{% endfor %}
{% endif %}

<h3>Acoustics</h3>
<h4>Objective measurement notes</h4>
<p>The Toolkit sound level meter is capable of measuring background noise level and assessing sound level privacy through sound level pressure differentials (between adjacent spaces).
	However, the only data that is automatically sent to the database backend is A-weighted sound level pressure measurements that are instantaneous readings at 30 second intervals. 
	From these readings, a general picture of background noise level can be obtained, though not an official reading. Refer to the Toolkit documentation for more information on proper
	interpretation of acoustic measurements.</p>
<h4>Survey vs. objective measurement notes</h4>
<p>The CBE survey acoustics questions cover satisfaction with noise level, sound privacy (speech privacy), and productivity. Often times, occupants are concerned with speech privacy
	which is not captured with simple background noise level measurement. Thus, the results of the survey and objective measurements may not be correlated.</p>
{% if user_chart_categories.acoustics > 0 %}
<h4>User charts</h4>
{% for chart in user_charts %}
	{% if chart.category == 'Acoustics' %}
		<img src="{{chart.url}}"><br>
		Figure: {{chart.caption}}<br>
	{% endif %}
{% endfor %}
{% endif %}
<h3>IAQ</h3>
<h4>Objective measurement notes</h4>
<p>CO<sub>2</sub> is currently the only objective measure of indoor air quality in the Toolkit, though users have the ability to manually enter other types of IAQ measurements. CO<sub>2</sub> is a proxy measurement for proper ventilation rates and should be used
	in conjunction with BMS data to ensure adherence to ASHRAE Standard 62.1. </p>
<h4>Survey vs. objective measurement notes</h4>
<p>The CBE survey IAQ questions cover sense of air quality and productivity. Humans are not good air quality sensors and tend to associate high thermal comfort with high air quality and
	vice versa. For this reason, indoor air quality is often better measured objectively using appropriate sensors depending on the suspected issue (particulates, VOCs, carbon monoxide, air toxics, etc.).</p>
{% if user_chart_categories.iaq > 0 %}
<h4>User charts</h4>
{% for chart in user_charts %}
	{% if chart.category == 'IAQ' %}
		<img src="{{chart.url}}"><br>
	{% endif %}
{% endfor %}
{% endif %}
</div>
